-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not refresh draft txn after redirect #44363
fix: do not refresh draft txn after redirect #44363
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chromemweb-chrome.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
// if transaction is from global create, the original behavior is that the user can change the recipient reportID | ||
// without having to reset the whole transaction, hence we don't need to re-init the transaction in this case | ||
if (transaction?.isFromGlobalCreate && transaction.transactionID) { | ||
IOU.resetMoneyRequestReportID(transaction.transactionID, reportID, isFromGlobalCreate); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this anymore. Now the back button uses the transaction's report id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When navigating back to the participants page we will use the transaction's report id in the uri param. Thus the condition above transaction?.reportID === reportID
will be met and we won't init the money request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Expensify/App/pull/44363/files#diff-5e5fc302dd5db871d26e30f810bc0606beccb7f50ae6ed6535cd93aaee98c280R193 in here, I only update this to fix the extra bug that I mentioned in the last PR
When you reload a scan IOU request in the confirmation step, it still use the route.params.reportID
to navigate back to the start step if it couldn't load the image locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In navigateToStartStepIfScanFileCannotBeRead
can we navigate to the scan step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, tested it and confirmed that it still renders the IOURequestStartPage component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt feel free to re-test it and let me know. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In navigateToStartStepIfScanFileCannotBeRead
we navigate the user to ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN
Line 6968 in 937c418
IOUUtils.navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID); |
What I'm asking is to change the route here so the user is navigated to ROUTES.MONEY_REQUEST_STEP_SCAN
and remove IOU.resetMoneyRequestReportID
as it won't be needed anymore
Screen.Recording.2024-06-28.at.4.52.32.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let me test that and get back to you shortly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt updated in the latest commit!
Signed-off-by: dominictb <[email protected]>
This reverts commit c857885.
This reverts commit da44443.
This reverts commit 5cd9f11.
This reverts commit d10afcb.
during initMoneyRequest Signed-off-by: dominictb <[email protected]>
Signed-off-by: dominictb <[email protected]>
reportID, | ||
isFromGlobalCreate, | ||
created, | ||
currency, | ||
transactionID: newTransactionID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we resetting all these props? Shouldn't be just the report id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that the transaction should look like it is re-created, so the data like reportID
, created
, currency
, even transactionID
(a bit redundant), isFromGlobalCreated
should be updated, but the other old data will be kept intact since iouRequestType
is the same
Signed-off-by: dominictb <[email protected]> Signed-off-by: dominictb <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just a NAB comment
Signed-off-by: dominictb <[email protected]>
@dominictb Can you please add missing screenshots / videos? |
Alright will do! |
@s77rt you mean supplementing the evidence for the new test case that we discussed or supplying the evidence for mobile platforms? I think in mobile platform we couldn't refresh the confirmation page, hence this bug doesn't apply. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.0.7-3 🚀
|
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
Details
avoid txn in Onyx get reset after IOU confirmation page refresh
Fixed Issues
$ #40936
PROPOSAL: #40936 (comment)
Tests
Result: On refreshing scan submit expense confirmation page all details must not be disappeared
Offline tests
QA Steps
Result: On refreshing scan submit expense confirmation page all details must not be disappeared
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
compressed_android.webm.mp4
iOS: Native
iOS: mWeb Safari
compressed_simulator.mp4.mp4
MacOS: Chrome / Safari
compressed_web.mov.mp4
MacOS: Desktop